package org.lsy.listener;

import org.lsy.utils.ContextUtils;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * @author liusy95
 * @version 1.0
 * @date 2020/7/2
 */
@WebListener
public class ContextLoaderListener implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("--------------start init context-----------------");
        ContextUtils.init();
        System.out.println("--------------init context success-----------------");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("--------------context destroy-----------------");
    }
}
